
/**
 * Sphere
 * @version 1.0
 * @since 1.0
 * <p>
 * Created by Murphy at 2021/7/9 15:50
 **/

#pragma once

#include "Hittable.hpp"
#include "material/Material.hpp"

#include <memory>

namespace Stitches
{

class Sphere : public Hittable
{
public:
    Sphere() {}

    Sphere(Vec3f center, double r, std::shared_ptr<Material> m) : mCenter(center), mRadius(r), mMat(m) {}

    virtual bool hit(const Ray &r, double t_min, double t_max, HitRecord &rec) const override;

private:
    Vec3f mCenter;
    double mRadius;
    std::shared_ptr<Material> mMat;
};

}
